import 'package:flutter/material.dart';

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("布局"), // 标题
          leading: Icon(Icons.menu), // 左侧图标
          actions: [Icon(Icons.settings)],  // 右侧图标数组
          elevation: 0.0,// 去掉阴影
          centerTitle: true, // 标题居中

        ),
        body:ContainerDemo()
    );
  }
}

class ContainerDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text(
        "Flutter 谷歌开发的一款开源，免费的，基于Dart 语言的移动 UI 框架，Android 上构建高质量的原生应用",
        style: TextStyle(
          fontSize: 20
        ),
      ),
      width:double.infinity , // 宽度自适应
      height: double.infinity,
      padding: EdgeInsets.all(10.0),
      margin: EdgeInsets.fromLTRB(10.0, 30.0, 0.0, 5.0),
      alignment: Alignment.center, // 内容对齐
      //transform: Matrix4.translationValues(100, 0, 0), // 平移
      //transform: Matrix4.rotationZ(-0.1), // 旋转
      decoration: BoxDecoration(
        // border: Border(
        //   top: BorderSide(
        //     width: 10.0,
        //     color:Colors.red
        //   ),
        //   bottom: BorderSide(
        //       width: 10.0,
        //       color:Colors.red
        //   ),
        //   right: BorderSide(
        //       width: 10.0,
        //       color:Colors.red
        //   ),
        //   left: BorderSide(
        //       width: 10.0,
        //       color:Colors.red
        //   ),
        // ),
        border: Border.all(width: 10.0,color: Colors.blue),
        //borderRadius: BorderRadius.all(Radius.circular(30))
        borderRadius: BorderRadius.only(topLeft: Radius.circular(30)),
        color: Colors.lightGreen[100], // 背景色
          // 设置渐变后，背景色失效
        gradient: LinearGradient(
          colors: [
            Colors.lightBlue,
            Colors.white12
          ]
        )
      ),
    );
  }
}
